home *** CD-ROM | disk | FTP | other *** search
- Subject: v12i036: C News alpha release, Part11/14
- Newsgroups: comp.sources.unix
- Sender: sources
- Approved: rs@uunet.UU.NET
-
- Submitted-by: utzoo!henry (Henry Spencer)
- Posting-number: Volume 12, Issue 36
- Archive-name: cnews/part11
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 11 (of 14)."
- if test -f 'lib.proto/newsgroups' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'lib.proto/newsgroups'\"
- else
- echo shar: Extracting \"'lib.proto/newsgroups'\" \(16226 characters\)
- sed "s/^X//" >'lib.proto/newsgroups' <<'END_OF_FILE'
- Xcontrol control message repository
- Xjunk rubbish bin
- Xutstat.general general-interest news for all users
- Xutstat.hacknews news primarily of interest to hacks
- Xutstat.gripes complaints (and answers thereto)
- Xutstat.deadletter disused dead-letter collection
- Xutstat.test local tests
- Xutstat.control
- Xutstat.junk
- Xto.utstat testing news links ...
- Xto.utgpu
- Xto.utzoo
- Xut.general U of T local groups ...
- Xut.16k
- Xut.vlsi
- Xut.supercomputer
- Xut.theory vague CSRI CS `theory' group
- Xut.na numerical applications
- Xtor.general Toronto local groups ...
- Xtor.news
- Xtor.news.stats
- Xont.general General news local to Ontario sites ...
- Xont.events Seminars and the like at Ont. sites
- Xont.jobs Help-wanted column for Ont. sites
- Xont.micro micro-processors for Ont. sites
- Xont.singles pain and pleasure of singlitude for Ont. sites
- Xont.uucp status reports on connections from utzoo for Ont. sites
- Xont.test
- Xont.sf-lovers
- Xcan.general general news local to Canadian sites ...
- Xcan.jobs
- Xcan.ai
- Xcan.politics
- Xcan.francais
- Xlist.ailist mailing lists from Bitnet...
- Xlist.bind
- Xlist.can-inet
- Xlist.comm-l
- Xlist.dtp
- Xlist.future-l
- Xlist.ibm-nets
- Xlist.info-1100
- Xlist.info-futures
- Xlist.info-nets
- Xlist.info-postscript
- Xlist.iso
- Xlist.license
- Xlist.macsyma
- Xlist.mail-l
- Xlist.mh-users
- Xlist.mh-workers
- Xlist.mhs_implementation
- Xlist.namedroppers
- Xlist.netmonth
- Xlist.netnws-l
- Xlist.neuron
- Xlist.news-makers
- Xlist.nl-kr
- Xlist.nnmail-l
- Xlist.rscsmods
- Xlist.rscsv2-l
- Xlist.s-comput
- Xlist.sas-l
- Xlist.security
- Xlist.servers
- Xlist.slug
- Xlist.spssx-l
- Xlist.std-l
- Xlist.sun-spots
- Xlist.texhax
- Xlist.texmag-l
- Xlist.trafic-l
- Xlist.trans-l
- Xlist.unix-sw
- Xlist.unix-tex
- Xlist.usrdir-l
- Xlist.vision-list
- Xlist.x400-l
- Xlist.xpert
- Xlist.domain-l
- Xlist.pc-token
- Xlist.big-lan
- Xlist.humanist
- Xlist.ibmtcp-l
- Xcomp.ai Artificial intelligence discussions.
- Xcomp.ai.digest Artificial Intelligence discussions. (Moderated)
- Xcomp.arch Computer architecture.
- Xcomp.binaries.amiga Encoded public domain programs in binary. (Moderated)
- Xcomp.binaries.atari.st Binary-only postings for the Atari ST. (Moderated)
- Xcomp.binaries.ibm.pc Binary-only postings for IBM PC/MS-DOS. (Moderated)
- Xcomp.binaries.mac Encoded Macintosh programs in binary. (Moderated)
- Xcomp.bugs.2bsd Reports of UNIX* version 2BSD related bugs.
- Xcomp.bugs.4bsd Reports of UNIX version 4BSD related bugs.
- Xcomp.bugs.4bsd.ucb-fixes Bug reports/fixes for BSD Unix. (Moderated)
- Xcomp.bugs.misc General UNIX bug reports and fixes (incl V7, uucp)
- Xcomp.bugs.sys5 Reports of USG (System III, V, etc.) bugs.
- Xcomp.cog-eng Cognitive engineering.
- Xcomp.compilers Compiler construction, theory, etc. (Moderated)
- Xcomp.databases Database and data management issues and theory.
- Xcomp.dcom.lans Local area network hardware and software.
- Xcomp.dcom.modems Data communications hardware and software.
- Xcomp.dcom.telecom Telecommunications digest. (Moderated)
- Xcomp.doc Archived public-domain documentation. (Moderated)
- Xcomp.doc.techreports Lists of technical reports. (Moderated)
- Xcomp.edu Computer science education.
- Xcomp.emacs EMACS editors of different flavors.
- Xcomp.graphics Computer graphics, art, animation, image processing.
- Xcomp.graphics.digest Graphics software, hardware, theory, etc. (Moderated)
- Xcomp.hypercube Massively parallel systems: hardware & software. (Moderated)
- Xcomp.lang.ada Discussion about Ada*.
- Xcomp.lang.apl Discussion about APL.
- Xcomp.lang.c Discussion about C.
- Xcomp.lang.c++ The object-oriented C++ language.
- Xcomp.lang.forth Discussion about Forth.
- Xcomp.lang.fortran Discussion about FORTRAN.
- Xcomp.lang.lisp Discussion about LISP.
- Xcomp.lang.misc Different computer languages not specifically listed.
- Xcomp.lang.modula2 Discussion about Modula-2.
- Xcomp.lang.pascal Discussion about Pascal.
- Xcomp.lang.prolog Discussion about PROLOG.
- Xcomp.lang.smalltalk Discussion about Smalltalk 80.
- Xcomp.laser-printers Laser printers, hardware & software. (Moderated)
- Xcomp.lsi Large scale integrated circuits.
- Xcomp.mail.elm Discussion and fixes for ELM mail system.
- Xcomp.mail.headers Gatewayed from the ARPA header-people list.
- Xcomp.mail.maps Various maps, including UUCP maps. (Moderated)
- Xcomp.mail.misc General discussions about computer mail.
- Xcomp.mail.uucp Mail in the uucp network environment.
- Xcomp.misc General topics about computers not covered elsewhere.
- Xcomp.newprod Announcements of new products of interest. (Moderated)
- Xcomp.org.decus DEC* Users' Society newsgroup.
- Xcomp.org.fidonet FidoNews digest, official news of FidoNet Assoc. (Moderated)
- Xcomp.org.usenix USENIX Association events and announcements.
- Xcomp.os.cpm Discussion about the CP/M operating system.
- Xcomp.os.eunice The SRI Eunice system.
- Xcomp.os.minix Discussion of Tanenbaum's MINIX system.
- Xcomp.os.misc General OS-oriented discussion not carried elsewhere.
- Xcomp.os.os9 Discussions about the os9 operating system. (Moderated)
- Xcomp.os.research Operating systems and related areas. (Moderated)
- Xcomp.os.vms DEC's VAX* line of computers & VMS.
- Xcomp.periphs Peripheral devices.
- Xcomp.protocols.appletalk Applebus hardware & software.
- Xcomp.protocols.kermit Info about the Kermit package. (Moderated)
- Xcomp.protocols.misc Various forms and types of FTP protocol.
- Xcomp.protocols.tcp-ip TCP and IP network protocols.
- Xcomp.risks Risks to the public from computers & users. (Moderated)
- Xcomp.society The impact of technology on society. (Moderated)
- Xcomp.sources.amiga Source code-only postings for the Amiga. (Moderated)
- Xcomp.sources.atari.st Source code-only postings for the Atari ST. (Moderated)
- Xcomp.sources.bugs Bug reports, fixes, discussion for posted sources
- Xcomp.sources.d For any discussion of source postings.
- Xcomp.sources.games Postings of recreational software. (Moderated)
- Xcomp.sources.mac Software for the Apple Macintosh. (Moderated)
- Xcomp.sources.misc Posting of software . (Moderated)
- Xcomp.sources.unix Postings of complete, UNIX-oriented sources. (Moderated)
- Xcomp.sources.wanted Requests for software and fixes.
- Xcomp.std.c Discussion about C language standards. (Moderated)
- Xcomp.std.internat Discussion about international standards.
- Xcomp.std.misc Discussion about various standards. (Moderated)
- Xcomp.std.mumps Discussion for the X11.1 committee on Mumps. (Moderated)
- Xcomp.std.unix Discussion for the P1003 committee on UNIX. (Moderated)
- Xcomp.sys.amiga Commodore Amiga: info&uses, but no programs.
- Xcomp.sys.apollo Apollo computer systems.
- Xcomp.sys.apple Discussion about Apple micros.
- Xcomp.sys.atari.8bit Discussion about 8 bit Atari micros.
- Xcomp.sys.atari.st Discussion about 16 bit Atari micros.
- Xcomp.sys.att Discussions about AT&T microcomputers.
- Xcomp.sys.cbm Discussion about Commodore micros.
- Xcomp.sys.dec Discussions about DEC computer systems.
- Xcomp.sys.hp Discussion about Hewlett-Packard equipment.
- Xcomp.sys.ibm.pc Discussion about IBM personal computers.
- Xcomp.sys.ibm.pc.digest The IBM PC, PC-XT, and PC-AT. (Moderated)
- Xcomp.sys.intel Disucussions about Intel systems and parts.
- Xcomp.sys.m6809 Discussion about 6809's.
- Xcomp.sys.m68k Discussion about 68k's.
- Xcomp.sys.m68k.pc Discussion about 68k-based PCs. (Moderated)
- Xcomp.sys.mac Discussions about the Apple Macintosh & Lisa.
- Xcomp.sys.mac.digest Apple Macintosh: info&uses, but no programs. (Moderated)
- Xcomp.sys.masscomp The Masscomp line of computers. (Moderated)
- Xcomp.sys.misc Discussion about computers of all kinds.
- Xcomp.sys.nsc.32k National Semiconductor 32000 series chips.
- Xcomp.sys.pyramid Pyramid 90x computers.
- Xcomp.sys.ridge Ridge 32 computers and ROS.
- Xcomp.sys.sequent Sequent systems, (esp. Balance 8000). (Moderated)
- Xcomp.sys.sun Sun "workstation" computers. (Moderated)
- Xcomp.sys.tandy Discussion about TRS-80's.
- Xcomp.sys.ti Discussion about Texas Instruments.
- Xcomp.sys.workstations Various workstation-type computers. (Moderated)
- Xcomp.terminals All sorts of terminals.
- Xcomp.text Text processing issues and methods.
- Xcomp.text.desktop Technolgy & techniques of desktop publishing. (Moderated)
- Xcomp.unix Discussion of UNIX* features and bugs. (Moderated)
- Xcomp.unix.questions UNIX neophytes group.
- Xcomp.unix.ultrix Discussions about DEC's Ultrix. (Moderated)
- Xcomp.unix.wizards Discussions, bug reports, and fixes on and for UNIX.
- Xcomp.unix.xenix Discussion about the Xenix OS.
- Xcomp.windows.misc Various issues about windowing systems.
- Xcomp.windows.news Sun Microsystems' NewS window system.
- Xcomp.windows.x Discussion about the X Window System.
- Xmisc.consumers Consumer interests, product reviews, etc.
- Xmisc.consumers.house Discussion about owning and maintaining a house.
- Xmisc.forsale Short, tasteful postings about items for sale.
- Xmisc.handicap Items of interest for/about the handicapped. (Moderated)
- Xmisc.headlines Current interest: drug testing, terrorism, etc.
- Xmisc.invest Investments and the handling of money.
- Xmisc.jobs.misc Discussion about employment, workplaces, careers.
- Xmisc.jobs.offered Announcements of positions available.
- Xmisc.jobs.resumes Postings of resumes and "situation wanted" articles.
- Xmisc.kids Children, their behavior and activities.
- Xmisc.legal Legalities and the ethics of law.
- Xmisc.misc Various discussions not fitting in any other group.
- Xmisc.psi Paranormal abilities and experiences. (Moderated)
- Xmisc.taxes Tax laws and advice.
- Xmisc.test For testing of network software. Very boring.
- Xmisc.wanted Requests for things that are needed (NOT software).
- Xnews.admin Comments directed to news administrators.
- Xnews.announce.conferences Calls for papers and conference announcements. (Moderated)
- Xnews.announce.important General announcements of interest to all. (Moderated)
- Xnews.announce.newusers Explanatory postings for new users. (Moderated)
- Xnews.config Postings of system down times and interruptions.
- Xnews.groups Discussions and lists of newsgroups.
- Xnews.lists News-related statistics and lists. (Moderated)
- Xnews.misc Discussions of USENET itself.
- Xnews.newsites Postings of new site announcements.
- Xnews.software.b Discussion about B news software.
- Xnews.software.notes Notesfile software from the Univ. of Illinois.
- Xnews.stargate Discussion about satellite transmission of news.
- Xnews.sysadmin Comments directed to system administrators.
- Xrec.arts.books Books of all genres, shapes, and sizes.
- Xrec.arts.comics The funnies, old and new.
- Xrec.arts.drwho Discussion about Dr. Who.
- Xrec.arts.int-fiction Discussions about interactive fiction.
- Xrec.arts.movies Discussions of movies and movie making.
- Xrec.arts.movies.reviews Reviews of movies. (Moderated)
- Xrec.arts.poems For the posting of poems.
- Xrec.arts.sf-lovers Science fiction lovers' newsgroup.
- Xrec.arts.startrek Star Trek, the TV show and the movies.
- Xrec.arts.tv The boob tube, its history, and past and current shows.
- Xrec.arts.tv.soaps Postings about soap operas.
- Xrec.arts.wobegon "A Prairie Home Companion" radio show discussion.
- Xrec.audio High fidelity audio.
- Xrec.autos Automobiles, automotive products and laws.
- Xrec.autos.tech Technical aspects of automobiles, et. al.
- Xrec.aviation Aviation rules, means, and methods.
- Xrec.bicycles Bicycles, related products and laws.
- Xrec.birds Hobbyists interested in bird watching.
- Xrec.boats Hobbyists interested in boating.
- Xrec.food.cooking Food, cooking, cookbooks, and recipes.
- Xrec.food.drink Wines and spirits.
- Xrec.food.recipes Recipes from the USENET Cookbook (troff & text). (Moderated)
- Xrec.food.veg Vegetarians.
- Xrec.games.board Discussion and hints on board games.
- Xrec.games.bridge Hobbyists interested in bridge.
- Xrec.games.chess Chess & computer chess.
- Xrec.games.empire Discussion and hints about Empire.
- Xrec.games.frp Discussion about Fantasy Role Playing games.
- Xrec.games.go Discussion about Go.
- Xrec.games.hack Discussion, hints, etc. about the Hack game.
- Xrec.games.misc Games and computer games.
- Xrec.games.pbm Discussion about Play by Mail games.
- Xrec.games.rogue Discussion and hints about Rogue.
- Xrec.games.trivia Discussion about trivia.
- Xrec.games.video Discussion about video games.
- Xrec.gardens Gardening, methods and results.
- Xrec.guns Discussions about firearms. (Moderated)
- Xrec.ham-radio Amateur Radio practices, contests, events, rules, etc.
- Xrec.ham-radio.packet Discussion about packet radio setups.
- Xrec.humor Jokes and the like. May be somewhat offensive.
- Xrec.humor.d Discussions on the content of rec.humor articles.
- Xrec.humor.funny Jokes that are funny (in the moderator's opinion). (Moderated)
- Xrec.humor.spc The Stupid People's Court! (Moderated)
- Xrec.mag Magazine summaries, tables of contents, etc.
- Xrec.mag.otherrealms Edited science fiction & fantasy "magazine". (Moderated)
- Xrec.misc General topics about recreational/participant sports.
- Xrec.motorcycles Motorcycles and related products and laws.
- Xrec.music.beatles Postings about the Fab Four & their music.
- Xrec.music.classical Discussion about classical music.
- Xrec.music.folk Folks discussing folk music of various sorts.
- Xrec.music.gaffa Progressive music (e.g., Kate Bush). (Moderated)
- Xrec.music.gdead A group for (Grateful) Dead-heads.
- Xrec.music.makers For performers and their discussions.
- Xrec.music.misc Music lovers' group.
- Xrec.music.synth Synthesizers and computer music.
- Xrec.nude Hobbyists interested in naturist/nudist activities.
- Xrec.pets Pets, pet care, and household animals in general.
- Xrec.photo Hobbyists interested in photography.
- Xrec.puzzles Puzzles, problems, and quizzes.
- Xrec.railroad Real and model train fans' newsgroup.
- Xrec.scuba Hobbyists interested in SCUBA diving.
- Xrec.skiing Hobbyists interested in skiing.
- Xrec.skydiving Hobbyists interested in skydiving.
- Xrec.sport.baseball Discussion about baseball.
- Xrec.sport.basketball Discussion about basketball.
- Xrec.sport.football Discussion about football.
- Xrec.sport.hockey Discussion about hockey.
- Xrec.sport.misc Spectator sports.
- Xrec.travel Traveling all over the world.
- Xrec.video Video and video components.
- Xrec.woodworking Hobbyists interested in woodworking.
- Xsci.astro Astronomy discussions and information.
- Xsci.bio Biology and related sciences.
- Xsci.crypt Different methods of data en/decryption.
- Xsci.electronics Circuits, theory, electrons and discussions.
- Xsci.lang Natural languages, communication, etc.
- Xsci.math Mathematical discussions and pursuits.
- Xsci.math.stat Statistics discussion.
- Xsci.math.symbolic Symbolic algebra discussion.
- Xsci.med Medicine and its related products and regulations.
- Xsci.med.aids AIDS: treatment, pathology/biology of HIV, prevention. (Moderated)
- Xsci.misc Short-lived discussions on subjects in the sciences.
- Xsci.philosophy.tech Technical philosophy: math, science, logic, etc.
- Xsci.physics Physical laws, properties, etc.
- Xsci.research Research methods, funding, ethics, and whatever.
- Xsci.space Space, space programs, space related research, etc.
- Xsci.space.shuttle The space shuttle and the STS program.
- Xsoc.college College, college activities, campus life, etc.
- Xsoc.culture.african Discussions about Africa & things African.
- Xsoc.culture.celtic Group about Celts (*not* basketball!).
- Xsoc.culture.greek Group about Greeks.
- Xsoc.culture.indian Group for discussion about India & things Indian.
- Xsoc.culture.jewish Group for discussion about Jewish culture & religion.
- Xsoc.culture.misc Group for discussion about other cultures.
- Xsoc.human-nets Computer aided communications digest. (Moderated)
- Xsoc.men Issues related to men, their problems & relationships.
- Xsoc.misc Socially-oriented topics not in other groups.
- Xsoc.motss Issues pertaining to homosexuality.
- Xsoc.net-people Announcements, requests, etc. about people on the net.
- Xsoc.politics Political problems, systems, solutions. (Moderated)
- Xsoc.politics.arms-d Arms discussion digest. (Moderated)
- Xsoc.religion.christian Christianity and related topics. (Moderated)
- Xsoc.roots Genealogical matters.
- Xsoc.singles Newsgroup for single people, their activities, etc.
- Xsoc.women Women's rights, discrimination, etc.
- Xtalk.abortion All sorts of discussions and arguments on abortion.
- Xtalk.bizarre The unusual, bizarre, curious, and often stupid.
- Xtalk.origins Evolution versus creationism (sometimes hot!).
- Xtalk.philosophy.misc Philosophical musings on all topics.
- Xtalk.politics.misc Political discussions and ravings of all kinds.
- Xtalk.politics.theory Theory of politics and political systems.
- Xtalk.religion.misc Religious, ethical, & moral implications.
- Xtalk.religion.newage Esoteric and minority religions & philosophies.
- Xtalk.rumors For the posting of rumors.
- END_OF_FILE
- if test 16226 -ne `wc -c <'lib.proto/newsgroups'`; then
- echo shar: \"'lib.proto/newsgroups'\" unpacked with wrong size!
- fi
- # end of 'lib.proto/newsgroups'
- fi
- if test -f 'libc/getdate.y' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libc/getdate.y'\"
- else
- echo shar: Extracting \"'libc/getdate.y'\" \(11603 characters\)
- sed "s/^X//" >'libc/getdate.y' <<'END_OF_FILE'
- X%token ID MONTH DAY MERIDIAN NUMBER UNIT MUNIT SUNIT ZONE DAYZONE AGO
- X%{
- X /* Steven M. Bellovin (unc!smb) */
- X /* Dept. of Computer Science */
- X /* University of North Carolina at Chapel Hill */
- X /* @(#)getdate.y 2.5 3/3/83 */
- X
- X#include <sys/types.h>
- X#ifdef USG
- Xstruct timeb
- X{
- X time_t time;
- X unsigned short millitm;
- X short timezone;
- X short dstflag;
- X};
- X#else
- X#include <sys/timeb.h>
- X#endif
- X#include <ctype.h>
- X#include <time.h>
- X
- X#define NULL 0
- X#define daysec (24L*60L*60L)
- X static int timeflag, zoneflag, dateflag, dayflag, relflag;
- X static time_t relsec, relmonth;
- X static int hh, mm, ss, merid, daylight;
- X static int dayord, dayreq;
- X static int month, day, year;
- X static int ourzone;
- X#define AM 1
- X#define PM 2
- X#define DAYLIGHT 1
- X#define STANDARD 2
- X#define MAYBE 3
- X%}
- X
- X%%
- Xtimedate: /* empty */
- X | timedate item;
- X
- Xitem: tspec =
- X {timeflag++;}
- X | zone =
- X {zoneflag++;}
- X | dtspec =
- X {dateflag++;}
- X | dyspec =
- X {dayflag++;}
- X | rspec =
- X {relflag++;}
- X | nspec;
- X
- Xnspec: NUMBER =
- X {if (timeflag && dateflag && !relflag) year = $1;
- X else {timeflag++;hh = $1/100;mm = $1%100;ss = 0;merid = 24;}};
- X
- Xtspec: NUMBER MERIDIAN =
- X {hh = $1; mm = 0; ss = 0; merid = $2;}
- X | NUMBER ':' NUMBER =
- X {hh = $1; mm = $3; merid = 24;}
- X | NUMBER ':' NUMBER MERIDIAN =
- X {hh = $1; mm = $3; merid = $4;}
- X | NUMBER ':' NUMBER ':' NUMBER =
- X {hh = $1; mm = $3; ss = $5; merid = 24;}
- X | NUMBER ':' NUMBER ':' NUMBER MERIDIAN =
- X {hh = $1; mm = $3; ss = $5; merid = $6;};
- X
- Xzone: ZONE =
- X {ourzone = $1; daylight = STANDARD;}
- X | DAYZONE =
- X {ourzone = $1; daylight = DAYLIGHT;};
- X
- Xdyspec: DAY =
- X {dayord = 1; dayreq = $1;}
- X | DAY ',' =
- X {dayord = 1; dayreq = $1;}
- X | NUMBER DAY =
- X {dayord = $1; dayreq = $2;};
- X
- Xdtspec: NUMBER '/' NUMBER =
- X {month = $1; day = $3;}
- X | NUMBER '/' NUMBER '/' NUMBER =
- X {month = $1; day = $3; year = $5;}
- X | MONTH NUMBER =
- X {month = $1; day = $2;}
- X | MONTH NUMBER ',' NUMBER =
- X {month = $1; day = $2; year = $4;}
- X | NUMBER MONTH =
- X {month = $2; day = $1;}
- X | NUMBER MONTH NUMBER =
- X {month = $2; day = $1; year = $3;};
- X
- X
- Xrspec: NUMBER UNIT =
- X {relsec += 60L * $1 * $2;}
- X | NUMBER MUNIT =
- X {relmonth += $1 * $2;}
- X | NUMBER SUNIT =
- X {relsec += $1;}
- X | UNIT =
- X {relsec += 60L * $1;}
- X | MUNIT =
- X {relmonth += $1;}
- X | SUNIT =
- X {relsec++;}
- X | rspec AGO =
- X {relsec = -relsec; relmonth = -relmonth;};
- X%%
- X
- Xstatic int mdays[12] =
- X {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
- X#define epoch 1970
- X
- Xextern struct tm *localtime();
- Xtime_t dateconv(mm, dd, yy, h, m, s, mer, zone, dayflag)
- Xint mm, dd, yy, h, m, s, mer, zone, dayflag;
- X{
- X time_t tod, jdate;
- X register int i;
- X time_t timeconv();
- X
- X if (yy < 0) yy = -yy;
- X if (yy < 100) yy += 1900;
- X mdays[1] = 28 + (yy%4 == 0);
- X if (yy < epoch || yy > 1999 || mm < 1 || mm > 12 ||
- X dd < 1 || dd > mdays[--mm]) return (-1);
- X jdate = dd-1;
- X for (i=0; i<mm; i++) jdate += mdays[i];
- X for (i = epoch; i < yy; i++) jdate += 365 + (i%4 == 0);
- X jdate *= daysec;
- X jdate += zone * 60L;
- X if ((tod = timeconv(h, m, s, mer)) < 0) return (-1);
- X jdate += tod;
- X if (dayflag==DAYLIGHT || (dayflag==MAYBE&&localtime(&jdate)->tm_isdst))
- X jdate += -1*60*60;
- X return (jdate);
- X}
- X
- Xtime_t dayconv(ord, day, now) int ord, day; time_t now;
- X{
- X register struct tm *loctime;
- X time_t tod;
- X time_t daylcorr();
- X
- X tod = now;
- X loctime = localtime(&tod);
- X tod += daysec * ((day - loctime->tm_wday + 7) % 7);
- X tod += 7*daysec*(ord<=0?ord:ord-1);
- X return daylcorr(tod, now);
- X}
- X
- Xtime_t timeconv(hh, mm, ss, mer) register int hh, mm, ss, mer;
- X{
- X if (mm < 0 || mm > 59 || ss < 0 || ss > 59) return (-1);
- X switch (mer) {
- X case AM: if (hh < 1 || hh > 12) return(-1);
- X return (60L * ((hh%12)*60L + mm)+ss);
- X case PM: if (hh < 1 || hh > 12) return(-1);
- X return (60L * ((hh%12 +12)*60L + mm)+ss);
- X case 24: if (hh < 0 || hh > 23) return (-1);
- X return (60L * (hh*60L + mm)+ss);
- X default: return (-1);
- X }
- X}
- Xtime_t monthadd(sdate, relmonth) time_t sdate, relmonth;
- X{
- X struct tm *ltime;
- X time_t dateconv();
- X time_t daylcorr();
- X int mm, yy;
- X
- X if (relmonth == 0) return 0;
- X ltime = localtime(&sdate);
- X mm = 12*ltime->tm_year + ltime->tm_mon + relmonth;
- X yy = mm/12;
- X mm = mm%12 + 1;
- X return daylcorr(dateconv(mm, ltime->tm_mday, yy, ltime->tm_hour,
- X ltime->tm_min, ltime->tm_sec, 24, ourzone, MAYBE), sdate);
- X}
- X
- Xtime_t daylcorr(future, now) time_t future, now;
- X{
- X int fdayl, nowdayl;
- X
- X nowdayl = (localtime(&now)->tm_hour+1) % 24;
- X fdayl = (localtime(&future)->tm_hour+1) % 24;
- X return (future-now) + 60L*60L*(nowdayl-fdayl);
- X}
- X
- Xstatic char *lptr;
- X
- Xyylex()
- X{
- X extern int yylval;
- X int sign;
- X register char c;
- X register char *p;
- X char idbuf[20];
- X int pcnt;
- X
- X for (;;) {
- X while (isspace(*lptr)) lptr++;
- X
- X if (isdigit(c = *lptr) || c == '-' || c == '+') {
- X if (c== '-' || c == '+') {
- X if (c=='-') sign = -1;
- X else sign = 1;
- X if (!isdigit(*++lptr)) {
- X /* yylval = sign; return (NUMBER); */
- X return yylex(); /* skip the '-' sign */
- X }
- X } else sign = 1;
- X yylval = 0;
- X while (isdigit(c = *lptr++)) yylval = 10*yylval + c - '0';
- X yylval *= sign;
- X lptr--;
- X return (NUMBER);
- X
- X } else if (isalpha(c)) {
- X p = idbuf;
- X while (isalpha(c = *lptr++) || c=='.')
- X *p++ = c;
- X *p = '\0';
- X lptr--;
- X return (lookup(idbuf));
- X }
- X
- X else if (c == '(') {
- X pcnt = 0;
- X do {
- X c = *lptr++;
- X if (c == '\0') return(c);
- X else if (c == '(') pcnt++;
- X else if (c == ')') pcnt--;
- X } while (pcnt > 0);
- X }
- X
- X else return (*lptr++);
- X }
- X}
- X
- Xstruct table {
- X char *name;
- X int type, value;
- X};
- X
- Xstruct table mdtab[] = {
- X {"January", MONTH, 1},
- X {"February", MONTH, 2},
- X {"March", MONTH, 3},
- X {"April", MONTH, 4},
- X {"May", MONTH, 5},
- X {"June", MONTH, 6},
- X {"July", MONTH, 7},
- X {"August", MONTH, 8},
- X {"September", MONTH, 9},
- X {"Sept", MONTH, 9},
- X {"October", MONTH, 10},
- X {"November", MONTH, 11},
- X {"December", MONTH, 12},
- X
- X {"Sunday", DAY, 0},
- X {"Monday", DAY, 1},
- X {"Tuesday", DAY, 2},
- X {"Tues", DAY, 2},
- X {"Wednesday", DAY, 3},
- X {"Wednes", DAY, 3},
- X {"Thursday", DAY, 4},
- X {"Thur", DAY, 4},
- X {"Thurs", DAY, 4},
- X {"Friday", DAY, 5},
- X {"Saturday", DAY, 6},
- X {0, 0, 0}};
- X
- X#define HRS *60
- X#define HALFHR 30
- Xstruct table mztab[] = {
- X {"a.m.", MERIDIAN, AM},
- X {"am", MERIDIAN, AM},
- X {"p.m.", MERIDIAN, PM},
- X {"pm", MERIDIAN, PM},
- X {"nst", ZONE, 3 HRS + HALFHR}, /* Newfoundland */
- X {"n.s.t.", ZONE, 3 HRS + HALFHR},
- X {"ast", ZONE, 4 HRS}, /* Atlantic */
- X {"a.s.t.", ZONE, 4 HRS},
- X {"adt", DAYZONE, 4 HRS},
- X {"a.d.t.", DAYZONE, 4 HRS},
- X {"est", ZONE, 5 HRS}, /* Eastern */
- X {"e.s.t.", ZONE, 5 HRS},
- X {"edt", DAYZONE, 5 HRS},
- X {"e.d.t.", DAYZONE, 5 HRS},
- X {"cst", ZONE, 6 HRS}, /* Central */
- X {"c.s.t.", ZONE, 6 HRS},
- X {"cdt", DAYZONE, 6 HRS},
- X {"c.d.t.", DAYZONE, 6 HRS},
- X {"mst", ZONE, 7 HRS}, /* Mountain */
- X {"m.s.t.", ZONE, 7 HRS},
- X {"mdt", DAYZONE, 7 HRS},
- X {"m.d.t.", DAYZONE, 7 HRS},
- X {"pst", ZONE, 8 HRS}, /* Pacific */
- X {"p.s.t.", ZONE, 8 HRS},
- X {"pdt", DAYZONE, 8 HRS},
- X {"p.d.t.", DAYZONE, 8 HRS},
- X {"yst", ZONE, 9 HRS}, /* Yukon */
- X {"y.s.t.", ZONE, 9 HRS},
- X {"ydt", DAYZONE, 9 HRS},
- X {"y.d.t.", DAYZONE, 9 HRS},
- X {"hst", ZONE, 10 HRS}, /* Hawaii */
- X {"h.s.t.", ZONE, 10 HRS},
- X {"hdt", DAYZONE, 10 HRS},
- X {"h.d.t.", DAYZONE, 10 HRS},
- X {"bst", ZONE, 11 HRS}, /* Bering */
- X {"b.s.t.", ZONE, 11 HRS},
- X {"bdt", DAYZONE, 11 HRS},
- X {"b.d.t.", DAYZONE, 11 HRS},
- X
- X {"gmt", ZONE, 0 HRS},
- X {"g.m.t.", ZONE, 0 HRS},
- X
- X {"aest", ZONE, -10 HRS}, /* Australian Eastern Time */
- X {"a.e.s.t.", ZONE, -10 HRS},
- X {"aesst", DAYZONE, -10 HRS}, /* Australian Eastern Summer Time */
- X {"a.e.s.s.t.", DAYZONE, -10 HRS},
- X {"acst", ZONE, -(9 HRS + HALFHR)}, /* Australian Central Time */
- X {"a.c.s.t.", ZONE, -(9 HRS + HALFHR)},
- X {"acsst", DAYZONE, -(9 HRS + HALFHR)}, /* Australian Central Summer */
- X {"a.c.s.s.t.", DAYZONE, -(9 HRS + HALFHR)},
- X {"awst", ZONE, -8 HRS}, /* Australian Western Time */
- X {"a.w.s.t.", ZONE, -8 HRS}, /* (no daylight time there, I'm told */
- X {0, 0, 0}};
- X
- Xstruct table unittb[] = {
- X {"year", MUNIT, 12},
- X {"month", MUNIT, 1},
- X {"fortnight", UNIT, 14*24*60},
- X {"week", UNIT, 7*24*60},
- X {"day", UNIT, 1*24*60},
- X {"hour", UNIT, 60},
- X {"minute", UNIT, 1},
- X {"min", UNIT, 1},
- X {"second", SUNIT, 1},
- X {"sec", SUNIT, 1},
- X {0, 0, 0}};
- X
- Xstruct table othertb[] = {
- X {"tomorrow", UNIT, 1*24*60},
- X {"yesterday", UNIT, -1*24*60},
- X {"today", UNIT, 0},
- X {"now", UNIT, 0},
- X {"last", NUMBER, -1},
- X {"this", UNIT, 0},
- X {"next", NUMBER, 2},
- X {"first", NUMBER, 1},
- X /* {"second", NUMBER, 2}, */
- X {"third", NUMBER, 3},
- X {"fourth", NUMBER, 4},
- X {"fifth", NUMBER, 5},
- X {"sixth", NUMBER, 6},
- X {"seventh", NUMBER, 7},
- X {"eigth", NUMBER, 8},
- X {"ninth", NUMBER, 9},
- X {"tenth", NUMBER, 10},
- X {"eleventh", NUMBER, 11},
- X {"twelfth", NUMBER, 12},
- X {"ago", AGO, 1},
- X {0, 0, 0}};
- X
- Xstruct table milzone[] = {
- X {"a", ZONE, 1 HRS},
- X {"b", ZONE, 2 HRS},
- X {"c", ZONE, 3 HRS},
- X {"d", ZONE, 4 HRS},
- X {"e", ZONE, 5 HRS},
- X {"f", ZONE, 6 HRS},
- X {"g", ZONE, 7 HRS},
- X {"h", ZONE, 8 HRS},
- X {"i", ZONE, 9 HRS},
- X {"k", ZONE, 10 HRS},
- X {"l", ZONE, 11 HRS},
- X {"m", ZONE, 12 HRS},
- X {"n", ZONE, -1 HRS},
- X {"o", ZONE, -2 HRS},
- X {"p", ZONE, -3 HRS},
- X {"q", ZONE, -4 HRS},
- X {"r", ZONE, -5 HRS},
- X {"s", ZONE, -6 HRS},
- X {"t", ZONE, -7 HRS},
- X {"u", ZONE, -8 HRS},
- X {"v", ZONE, -9 HRS},
- X {"w", ZONE, -10 HRS},
- X {"x", ZONE, -11 HRS},
- X {"y", ZONE, -12 HRS},
- X {"z", ZONE, 0 HRS},
- X {0, 0, 0}};
- X
- Xlookup(id) char *id;
- X{
- X#define gotit (yylval=i->value, i->type)
- X#define getid for(j=idvar, k=id; *j++ = *k++; )
- X
- X char idvar[20];
- X register char *j, *k;
- X register struct table *i;
- X int abbrev;
- X
- X getid;
- X if (strlen(idvar) == 3) abbrev = 1;
- X else if (strlen(idvar) == 4 && idvar[3] == '.') {
- X abbrev = 1;
- X idvar[3] = '\0';
- X }
- X else abbrev = 0;
- X
- X if (islower(*idvar)) *idvar = toupper(*idvar);
- X
- X for (i = mdtab; i->name; i++) {
- X k = idvar;
- X for (j = i->name; *j++ == *k++;) {
- X if (abbrev && j==i->name+3) return gotit;
- X if (j[-1] == 0) return gotit;
- X }
- X }
- X
- X getid;
- X for (i = mztab; i->name; i++)
- X if (strcmp(i->name, idvar) == 0) return gotit;
- X
- X for (j = idvar; *j; j++) if (isupper(*j)) *j = tolower(*j);
- X for (i=mztab; i->name; i++)
- X if (strcmp(i->name, idvar) == 0) return gotit;
- X
- X getid;
- X for (i=unittb; i->name; i++)
- X if (strcmp(i->name, idvar) == 0) return gotit;
- X
- X if (idvar[strlen(idvar)-1] == 's') idvar[strlen(idvar)-1] = '\0';
- X for (i=unittb; i->name; i++)
- X if (strcmp(i->name, idvar) == 0) return gotit;
- X
- X getid;
- X for (i = othertb; i->name; i++)
- X if (strcmp(i->name, idvar) == 0) return gotit;
- X
- X getid;
- X if (strlen(idvar) == 1 && isalpha(*idvar)) {
- X if (isupper(*idvar)) *idvar = tolower(*idvar);
- X for (i = milzone; i->name; i++)
- X if (strcmp(i->name, idvar) == 0) return gotit;
- X }
- X
- X return(ID);
- X}
- X
- Xtime_t getdate(p, now) char *p; struct timeb *now;
- X{
- X#define mcheck(f) if (f>1) err++
- X time_t monthadd();
- X int err;
- X struct tm *lt;
- X struct timeb ftz;
- X
- X time_t sdate, tod;
- X
- X lptr = p;
- X if (now == ((struct timeb *) NULL)) {
- X now = &ftz;
- X ftime(&ftz);
- X }
- X lt = localtime(&now->time);
- X year = lt->tm_year;
- X month = lt->tm_mon+1;
- X day = lt->tm_mday;
- X relsec = 0; relmonth = 0;
- X timeflag=zoneflag=dateflag=dayflag=relflag=0;
- X ourzone = now->timezone;
- X daylight = MAYBE;
- X hh = mm = ss = 0;
- X merid = 24;
- X
- X if (err = yyparse()) return (-1);
- X
- X mcheck(timeflag);
- X mcheck(zoneflag);
- X mcheck(dateflag);
- X mcheck(dayflag);
- X
- X if (err) return (-1);
- X
- X if (dateflag || timeflag || dayflag) {
- X sdate = dateconv(month,day,year,hh,mm,ss,merid,ourzone,daylight);
- X if (sdate < 0) return -1;
- X }
- X else {
- X sdate = now->time;
- X if (relflag == 0)
- X sdate -= (lt->tm_sec + lt->tm_min*60 +
- X lt->tm_hour*(60L*60L));
- X }
- X
- X sdate += relsec;
- X sdate += monthadd(sdate, relmonth);
- X
- X if (dayflag) {
- X tod = dayconv(dayord, dayreq, sdate);
- X sdate += tod;
- X }
- X
- X return sdate;
- X}
- X
- Xyyerror(s) char *s;
- X{}
- END_OF_FILE
- if test 11603 -ne `wc -c <'libc/getdate.y'`; then
- echo shar: \"'libc/getdate.y'\" unpacked with wrong size!
- fi
- # end of 'libc/getdate.y'
- fi
- if test -f 'rna/notes/Diffs' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rna/notes/Diffs'\"
- else
- echo shar: Extracting \"'rna/notes/Diffs'\" \(16211 characters\)
- sed "s/^X//" >'rna/notes/Diffs' <<'END_OF_FILE'
- XFrom nuucp Sun Oct 7 04:41:24 1984
- X>From decvax!mulga!michaelr:elecvax Sun Oct 7 04:28:09 1984 remote from ihnp4
- XFrom: ihnp4!decvax!mulga!michaelr:elecvax
- XReceived: by ihnp4.ATT.UUCP; id AA13572; 7 Oct 84 04:28:09 CDT (Sun)
- XReturn-Path: <decvax!mulga!michaelr:elecvax>
- XReceived: by decvax.UUCP (4.12/1.0)
- X id AA19171; Sun, 7 Oct 84 04:50:18 edt
- XMessage-Id: <8410070850.AA19171@decvax.UUCP>
- XReceived: by mulga.OZ (4.3)
- X id AA25613; Fri, 5 Oct 84 19:32:39 EST
- XDate: Fri, 5 Oct 84 18:22:05 EST
- XTo: ihnp4!jett!bill@decvax.UUCP:mulga
- XSubject: Final Update of News Software (says he hopefully)
- X
- XHere are the changes I warned you about, note that a big chunk was moved from
- Xreadnews.c to funcs.c. If you are now totally confused, I'll resend anything
- Xyou like.
- X
- XCHANGE SUMMARY (includes some changes you got in the last distribution)
- X
- X subscription lists can be altered without editing .newsrc
- X (readnews -s[+-?] [group])
- X
- X control commands added: "sendsys, senduuname, version"
- X a response will always be sent
- X
- X subscription list matching is upward compatible with 2.10.2: X matches X.thing
- X (X.all still matches X - I think it should)
- X
- X new groups aren't created automatically anymore, article is placed
- X in "junk" group, and a warning issued
- X
- X when new groups are created, "active" gets an empty entry, but the
- X existance of the directory still indicates subscription
- X (regardless of "active").
- X
- X some local mods to postnews, re default sub. lists (won't be of much use
- X to you)
- X
- XI believe there should now be NO compatability problems with news 2.10.2
- X
- XDIFFS OF CHANGED FILES:
- X
- X----------
- Xactive.c
- X----------
- X138d137
- X< extern char *itoa();
- X148a148,173
- X> fclose(f);
- X> #if !AUSAM
- X> unlock(actname);
- X> #endif
- X> }
- X>
- X> /*
- X> * initgrp - initialise an entry for this group
- X> */
- X> initgrp(group)
- X> char *group;
- X> {
- X> register FILE *f;
- X> char gbuf[BUFSIZ / 2], dbuf[BUFSIZ / 4], dbuf2[BUFSIZ / 4];
- X>
- X> f = fopenl(actname);
- X> lineno = 0;
- X> while(getline(f, gbuf, dbuf, dbuf2))
- X> if(CMP(gbuf, group) == 0)
- X> {
- X> #if !AUSAM
- X> unlock(actname);
- X> #endif
- X> return;
- X> }
- X> fprintf(f, "%s 00000 00001\n", group);
- X
- X----------
- Xdefs.h
- X----------
- X12c12
- X< #define NEWSVERSION "B UNSW 1.0 3/14/84"
- X---
- X> #define NEWSVERSION "B UNSW 1.1 19 Sep 1984"
- X18,19c18,19
- X< #define DFLTSUB "general,general.all" /* default subscription list */
- X< #define ADMSUB "general" /* Mandatory subscription list */
- X---
- X> #define DFLTSUB "system,general" /* default subscription list */
- X> #define ADMSUB "system" /* Mandatory subscription list */
- X36,37c36
- X< #define NETPATH 1 /* if you have path finding program
- X< /bin/netpath */
- X---
- X> #define NETPATH "/bin/netpath" /* if you have path finding program */
- X57a57,58
- X> #define MC "/bin/mc"
- X> #define UUNAME "ls /tmp/net ^ grep '^[a-z]'" /* uuname program */
- X159,160c160,161
- X< char *catstr2(), *bsearch(), *mtempnam();
- X< char *getunique();
- X---
- X> char *catstr2(), *bsearch(), *mtempnam(), *newstr6();
- X> char *getunique(), *getretaddr(), *getsubject();
- X
- X----------
- Xfuncs.c
- X----------
- X68a69,75
- X> newstr6(s1, s2, s3, s4, s5, s6)
- X> char *s1, *s2, *s3, *s4, *s5, *s6;
- X> {
- X> return strcat(strcat(strcat(strcat(strcat(strcpy(myalloc(strlen(s1) + strlen(s2) + strlen(s3) + strlen(s4) + strlen(s5) + strlen(s6) + 1), s1), s2), s3), s4), s5), s6);
- X> }
- X>
- X> char *
- X89a97,98
- X> * sublist uses "all" like shell uses "*", and "." like shell uses "/"
- X> * if subscription X matches Y, it also matches Y.anything
- X159c168,169
- X< return *ng2 == '\0'; /* if "\0"'s line up - match */
- X---
- X> return (*ng2 == '\0' || *ng2 == '.');
- X> /* full match or X matching X.thing */
- X405a416,571
- X> }
- X>
- X> /*
- X> * generate a return address
- X> */
- X> char *
- X> getretaddr(hp)
- X> header *hp;
- X> {
- X> register char *ra;
- X>
- X> extern char *getpath(), *exaddress();
- X> #ifdef NETPATH
- X> extern char *getnetpath();
- X> #endif
- X>
- X> if(hp->h_replyto)
- X> ra = exaddress(hp->h_replyto);
- X> else if(hp->h_from)
- X> ra = exaddress(hp->h_from);
- X> else
- X> ra = NIL(char);
- X> if(hp->h_path && !ra)
- X> ra = getpath(hp->h_path);
- X> #ifdef NETPATH
- X> if(CMPN(ra, PATHPREF, sizeof(PATHPREF) - 1) == 0)
- X> ra = getnetpath(ra);
- X> #endif
- X> return ra;
- X> }
- X>
- X> /*
- X> * try and make a proper address
- X> */
- X> char *
- X> exaddress(addr)
- X> char *addr;
- X> {
- X> register char *space, *dot, *at;
- X> register char *raddr;
- X>
- X> raddr = NIL(char);
- X> if(space = strchr(addr, ' '))
- X> *space = '\0';
- X> if(at = strchr(addr, '@'))
- X> {
- X> *at = '\0';
- X> if(dot = strchr(at + 1, '.'))
- X> {
- X> *dot = '\0';
- X> #if OZ
- X> if(CMP(dot + 1, MYDOMAIN) == 0)
- X> raddr = newstr3(addr, ":", at + 1);
- X> else
- X> #endif
- X> raddr = newstr4(PATHPREF, at + 1, PSEPS, addr);
- X> *dot = '.';
- X> }
- X> *at = '@';
- X> }
- X> if(space)
- X> *space = ' ';
- X> return raddr;
- X>
- X> }
- X>
- X> /*
- X> * return the last two components of the path
- X> */
- X> char *
- X> getpath(path)
- X> char *path;
- X> {
- X> register char *exlast, *ex;
- X> register char *raddr;
- X>
- X> if(exlast = strrchr(path, PSEPCHAR))
- X> {
- X> *exlast = '\0';
- X> if(ex = strrchr(path, PSEPCHAR))
- X> raddr = newstr4(PATHPREF, ex + 1, PSEPS, exlast + 1);
- X> else
- X> raddr = newstr3(path, PSEPS, exlast + 1);
- X> *exlast = PSEPCHAR;
- X> }
- X> else
- X> raddr = NIL(char);
- X> return raddr;
- X> }
- X>
- X> #ifdef NETPATH
- X> /*
- X> * try and work out a path from our "netpath" database
- X> */
- X> char *
- X> getnetpath(path)
- X> char *path;
- X> {
- X> FILE *f;
- X> register char *ex1, *ex2, *com, *new;
- X> char buf[BUFSIZ];
- X>
- X> if((ex1 = strchr(path, PSEPCHAR))
- X> && (ex2 = strchr(ex1 + 1, PSEPCHAR)))
- X> {
- X> *ex2 = '\0';
- X> com = newstr4("exec ", NETPATH, " mulga ", ex1 + 1);
- X> if((f = popen(com, "r")) == NIL(FILE))
- X> printf("Couldn't run \"%s\"\n", com);
- X> else
- X> {
- X> fread(buf, sizeof(buf), 1, f);
- X> if(pclose(f) != 0)
- X> {
- X> printf("Error in running \"%s\"\n", com);
- X> fflush(stdout);
- X> }
- X> else if(CMPN(buf, "mulga!", 6) == 0)
- X> {
- X> if(ex1 = strchr(buf, '\n'))
- X> *ex1 = '\0';
- X> new = newstr4(buf + 6, PSEPS, ex2 + 1, ":mulga");
- X> free(path);
- X> path = new;
- X> }
- X> }
- X> free(com);
- X> *ex2 = PSEPCHAR;
- X> }
- X> return path;
- X>
- X> }
- X> #endif
- X>
- X> /*
- X> * remove extra spaces, and insert separators if necessary in
- X> * newsgroups specification
- X> */
- X> convgrps(sp)
- X> register char *sp;
- X> {
- X> register char *sep;
- X>
- X> sep = NIL(char);
- X> while(*sp)
- X> {
- X> if(sep)
- X> sp++;
- X> while(*sp && (isspace(*sp) || *sp == NGSEPCHAR))
- X> strcpy(sp, sp + 1);
- X> if(sep)
- X> *sep = (*sp ? NGSEPCHAR : '\0');
- X> while(*sp && !isspace(*sp) && *sp != NGSEPCHAR)
- X> sp++;
- X> sep = sp;
- X> }
- X
- X----------
- Xnewsrc.c
- X----------
- X174c174,180
- X< if(ap->a_low - 1 > np->n_last)
- X---
- X> /*
- X> * if we haven't read any news for a while (or at all),
- X> * or somehow seq got smaller (active corrupted?),
- X> * set last read to oldest available article
- X> */
- X> if(ap->a_low - 1 > np->n_last
- X> || ap->a_seq < np->n_last)
- X
- X----------
- Xpostnews.c
- X----------
- X14a15,16
- X> extern char mydomain[];
- X> extern char newsversion[];
- X19a22,24
- X> #ifdef UUNAME
- X> char uuname[] = UUNAME;
- X> #endif
- X47a53,54
- X> char *dfltgrp();
- X> extern FILE *mailreply();
- X157a165,172
- X> if(!h.h_replyto)
- X> h.h_replyto = newstr5(
- X> #if AUSAM
- X> pe.pw_strings[LNAME],
- X> #else
- X> pp->pw_name,
- X> #endif
- X> "@", systemid, ".", mydomain);
- X172c187,189
- X< if(!h.h_newsgroups)
- X---
- X> if(h.h_newsgroups)
- X> convgrps(h.h_newsgroups);
- X> else
- X173a191,196
- X> if(h.h_distribution)
- X> {
- X> convgrps(h.h_distribution);
- X> if(CMP(h.h_newsgroups, h.h_distribution) == 0)
- X> h.h_distribution = NIL(char);
- X> }
- X191c214
- X< if(applyng(h.h_newsgroups, checkng))
- X---
- X> if(!cflag && applyng(h.h_newsgroups, checkng))
- X208a232
- X> initgrp(grp); /* make entry in active file */
- X301c325
- X< h.h_subject = geth(t_subject, "");
- X---
- X> h.h_subject = geth(t_subject, NIL(char));
- X305c329
- X< h.h_newsgroups = geth(t_newsgroups, DFLTGRP);
- X---
- X> h.h_newsgroups = geth(t_newsgroups, dfltgrp());
- X309,314c333
- X< h.h_distribution = geth(t_distribution,
- X< (h.h_newsgroups ? h.h_newsgroups
- X< : DFLTGRP));
- X< if(h.h_distribution && h.h_newsgroups
- X< && CMP(h.h_distribution, h.h_newsgroups) == 0)
- X< h.h_distribution = NIL(char);
- X---
- X> h.h_distribution = geth(t_distribution, h.h_newsgroups);
- X332c351
- X< if(*def)
- X---
- X> if(def)
- X338,339c357,358
- X< if(*def)
- X< return NIL(char);
- X---
- X> if(def)
- X> return newstr(def);
- X379c398
- X< h.h_messageid = catstr2(h.h_messageid, MYDOMAIN, ">");
- X---
- X> h.h_messageid = catstr2(h.h_messageid, mydomain, ">");
- X463c482
- X< if(ccount < 5 && !pflag && !cflag)
- X---
- X> if(ccount < 5 && !pflag)
- X704c723
- X< register char *s;
- X---
- X> register char *s, *com;
- X716c735,738
- X< creatgroup(g);
- X---
- X> com = newstr6("exec ", POSTNEWS, " -c 'newgroup ", g,
- X> "' -n ", g);
- X> system(com);
- X> free(com);
- X733a756,757
- X> static char junk[] = "junk";
- X>
- X741c765,771
- X< applyng(newg, linkng, tmpname);
- X---
- X> if(!applyng(newg, linkng, tmpname))
- X> {
- X> while(!linkng(junk, tmpname))
- X> creatgroup(junk);
- X> fprintf(stderr, "postnews: article placed in \"junk\" because no groups active from:\n\t%s\n",
- X> newg);
- X> }
- X758,764c788,791
- X< if(pflag)
- X< {
- X< dname = convg(newstr3(newsdir, "/", g));
- X< if(access(dname, 0) != 0)
- X< creatgroup(g);
- X< free(dname);
- X< }
- X---
- X> dname = convg(newstr3(newsdir, "/", g));
- X> free(dname);
- X> if(access(dname, 0) != 0)
- X> return 0; /* don't save - not an active group */
- X771a799
- X> return 1;
- X782a811
- X> {
- X783a813,815
- X> while(*s && isspace(*s))
- X> s++;
- X> }
- X784a817,819
- X> {
- X> if(!s || !*s)
- X> error("Cancel: message-id not specified.");
- X785a821
- X> }
- X786a823,825
- X> {
- X> if(!s || !*s)
- X> error("Newgroup: group name not specified.");
- X788c827
- X< error("Permission denied.");
- X---
- X> error("Newgroup: permission denied.");
- X790a830,836
- X> }
- X> else if(CMP(com, "sendsys") == 0)
- X> sendsys();
- X> else if(CMP(com, "version") == 0)
- X> version();
- X> else if(CMP(com, "senduuname") == 0)
- X> senduuname();
- X792,793c838,844
- X< error("Unknown control command: %s (Valid: cancel, newgroup)",
- X< com);
- X---
- X> {
- X> sorry(com);
- X> error("Unknown control command: %s %s\n(Valid: cancel, newgroup, sendsys, senduuname, version)\nSent from: %s",
- X> com, s ? s : "",
- X> (h.h_replyto ? h.h_replyto
- X> : (h.h_from ? h.h_from : "Unknown?")));
- X> }
- X796a848,958
- X> * send sys file to originator
- X> */
- X> sendsys()
- X> {
- X> register FILE *pp, *fp;
- X> register int c;
- X>
- X> fp = fopenf(sys, "r");
- X> pp = mailreply("News sendsys request");
- X> while((c = getc(fp)) != EOF)
- X> putc(c, pp);
- X> mailclose(pp);
- X> fclose(fp);
- X> }
- X>
- X> /*
- X> * send version name and number to originator
- X> */
- X> version()
- X> {
- X> register FILE *pp;
- X>
- X> pp = mailreply("News version request");
- X> fprintf(pp, "Current version: %s\n", newsversion);
- X> mailclose(pp);
- X> fclose(pp);
- X> }
- X>
- X> /*
- X> * send uuname data to originator
- X> */
- X> senduuname()
- X> {
- X> register FILE *pp, *f;
- X> register int c;
- X>
- X> extern FILE *tmpfile();
- X>
- X> #ifndef UUNAME
- X> sorry("uuname");
- X> #else
- X> if((pp = popen(uuname, "r")) == NIL(FILE))
- X> error("Couldn't run \"%s\"", uuname);
- X> if((f = tmpfile()) == NIL(FILE))
- X> error("Can't open tmp file.");
- X>
- X> while((c = getc(pp)) != EOF)
- X> putc(c, f);
- X>
- X> if(pclose(pp) != 0)
- X> error("\"%s\" had bad exit status.", uuname);
- X> rewind(f);
- X>
- X> pp = mailreply("News senduuname request");
- X> while((c = getc(f)) != EOF)
- X> putc(c, pp);
- X>
- X> fclose(f);
- X> mailclose(pp);
- X> #endif
- X> }
- X>
- X>
- X> /*
- X> * send message about unimplemented command
- X> */
- X> sorry(com)
- X> char *com;
- X> {
- X> register FILE *pp;
- X>
- X> pp = mailreply("Unimplemented news control message");
- X> fprintf(pp, "The control message \"%s\" is not implemented at this site.\n", com);
- X> fprintf(pp, "Our current version of news is: %s\n", newsversion);
- X> mailclose(pp);
- X> fclose(pp);
- X> }
- X>
- X> /*
- X> * set up a pipe to a mail program to reply to control requests
- X> */
- X> FILE *
- X> mailreply(s)
- X> char *s;
- X> {
- X> register FILE *pp;
- X> register char *com, *ra;
- X>
- X> if((ra = getretaddr(&h)) == NIL(char))
- X> error("Can't form return address for control message");
- X> com = newstr4("exec ", MAIL, " ", ra);
- X> if((pp = popen(com, "w")) == NIL(FILE))
- X> error("Couldn't run \"%s\"", com);
- X> fprintf(pp, "Subject: %s\n", s);
- X> fprintf(pp, "Responding-system: %s.%s\n\n", systemid, mydomain);
- X> free(com);
- X> free(ra);
- X> return pp;
- X> }
- X>
- X> /*
- X> * close the mail pipe
- X> */
- X> mailclose(pp)
- X> FILE *pp;
- X> {
- X> if(pclose(pp) != 0)
- X> error("Mail reply for control message failed");
- X> }
- X>
- X> /*
- X844a1007,1031
- X> }
- X>
- X> /*
- X> * work out the default group for this user
- X> */
- X> char *
- X> dfltgrp()
- X> {
- X> #if MANGRPS
- X> register char **sp;
- X> extern char **getclasses();
- X>
- X> for(sp = getclasses(pe.pw_cmask); *sp; sp++)
- X> {
- X> if(CMP(*sp, "C-Staff") == 0 || CMP(*sp, "System") == 0)
- X> return "system";
- X> if(CMP(*sp, "CLUBS") == 0)
- X> return newstr2("general.club.", pe.pw_strings[LNAME]);
- X> if(CMP(*sp, "Languages") == 0)
- X> return newstr2("general.lang.", pe.pw_strings[LNAME]);
- X> if(CMP(*sp, "Classaccount") == 0)
- X> return newstr2("class.", pe.pw_strings[LNAME]);
- X> }
- X> #endif
- X> return DFLTGRP;
- X
- X----------
- Xreadnews.c
- X----------
- X63,65d62
- X< char *getnetpath();
- X< char *getsubject(), *exaddress(), *getpath();
- X<
- X112c109,111
- X< if(!nflag)
- X---
- X> if(nflag)
- X> convgrps(nflag);
- X> else
- X113a113,114
- X> if(rcgrps)
- X> convgrps(rcgrps);
- X318c319
- X< register char *tmp;
- X---
- X> register char *tmp, *com;
- X325c326,327
- X< if((f = popen("exec /bin/mc", "w")) == NULL)
- X---
- X> com = newstr2("exec ", MC);
- X> if((f = popen(com, "w")) == NULL)
- X326a329
- X> free(com);
- X1057,1069c1060
- X< if(hp->h_replyto)
- X< argv[argc++] = exaddress(hp->h_replyto);
- X< else if(hp->h_from)
- X< argv[argc++] = exaddress(hp->h_from);
- X< else
- X< argv[argc++] = NIL(char);
- X< if(hp->h_path && !argv[argc - 1])
- X< argv[argc - 1] = getpath(hp->h_path);
- X< #if NETPATH
- X< if(CMPN(argv[argc - 1], PATHPREF, sizeof(PATHPREF) - 1) == 0)
- X< argv[argc - 1] = getnetpath(argv[argc - 1]);
- X< #endif
- X< if(!argv[argc - 1])
- X---
- X> if((argv[argc++] = getretaddr(hp)) == NIL(char))
- X1105,1208d1095
- X<
- X< /*
- X< * try and make a proper address
- X< */
- X< char *
- X< exaddress(addr)
- X< char *addr;
- X< {
- X< register char *space, *dot, *at;
- X< register char *raddr;
- X<
- X< raddr = NIL(char);
- X< if(space = strchr(addr, ' '))
- X< *space = '\0';
- X< if(at = strchr(addr, '@'))
- X< {
- X< *at = '\0';
- X< if(dot = strchr(at + 1, '.'))
- X< {
- X< *dot = '\0';
- X< #if OZ
- X< if(CMP(dot + 1, "SUN") == 0 /* compatability */
- X< || CMP(dot + 1, "OZ") == 0)
- X< raddr = newstr3(addr, ":", at + 1);
- X< else
- X< #endif
- X< raddr = newstr4(PATHPREF, at + 1, PSEPS, addr);
- X< *dot = '.';
- X< }
- X< *at = '@';
- X< }
- X< if(space)
- X< *space = ' ';
- X< return raddr;
- X<
- X< }
- X<
- X< /*
- X< * return the last two components of the path
- X< */
- X< char *
- X< getpath(path)
- X< char *path;
- X< {
- X< register char *exlast, *ex;
- X< register char *raddr;
- X<
- X< if(exlast = strrchr(path, PSEPCHAR))
- X< {
- X< *exlast = '\0';
- X< if(ex = strrchr(path, PSEPCHAR))
- X< raddr = newstr4(PATHPREF, ex + 1, PSEPS, exlast + 1);
- X< else
- X< raddr = newstr3(path, PSEPS, exlast + 1);
- X< *exlast = PSEPCHAR;
- X< }
- X< else
- X< raddr = NIL(char);
- X< return raddr;
- X< }
- X<
- X< #if NETPATH
- X< /*
- X< * try and work out a path from our "netpath" database
- X< */
- X< char *
- X< getnetpath(path)
- X< char *path;
- X< {
- X< FILE *f;
- X< register char *ex1, *ex2, *com, *new;
- X< char buf[BUFSIZ];
- X<
- X< if((ex1 = strchr(path, PSEPCHAR))
- X< && (ex2 = strchr(ex1 + 1, PSEPCHAR)))
- X< {
- X< *ex2 = '\0';
- X< com = newstr2("exec /bin/netpath mulga ", ex1 + 1);
- X< if((f = popen(com, "r")) == NIL(FILE))
- X< printf("Couldn't run \"%s\"\n", com);
- X< else
- X< {
- X< fread(buf, sizeof(buf), 1, f);
- X< if(pclose(f) != 0)
- X< {
- X< printf("Error in running \"%s\"\n", com);
- X< fflush(stdout);
- X< }
- X< else if(CMPN(buf, "mulga!", 6) == 0)
- X< {
- X< if(ex1 = strchr(buf, '\n'))
- X< *ex1 = '\0';
- X< new = newstr4(buf + 6, PSEPS, ex2 + 1, ":mulga");
- X< free(path);
- X< path = new;
- X< }
- X< }
- X< free(com);
- X< *ex2 = PSEPCHAR;
- X< }
- X< return path;
- X<
- X< }
- X< #endif
- X
- XTHE END!
- X
- XHopefully you won't see any more of this!
- XPlease tell me if you have any problems.
- X
- XMichael
- END_OF_FILE
- if test 16211 -ne `wc -c <'rna/notes/Diffs'`; then
- echo shar: \"'rna/notes/Diffs'\" unpacked with wrong size!
- fi
- # end of 'rna/notes/Diffs'
- fi
- echo shar: End of archive 11 \(of 14\).
- ## End of shell archive.
- exit 0
-